package com.byinsight.web.actions.dimension;

import com.byinsight.web.actions.CheckSessionAction;

//create a dimension (not a dimension item)
public class DeleteDimensionAction extends CheckSessionAction {
	private static final long serialVersionUID = -3218242971782020616L;
	private String dimid;
	
	@Override
	protected String process() {		
		dimensionManager.deleteDimension(getDimid());
		return null;
	}

	/* common */
	public void setDimid(String dimid) {
		this.dimid = dimid;
	}
	
	private String getDimid() {
		String PREFIX = "dim_";
		if(dimid != null && dimid.indexOf(PREFIX) == 0)
			dimid = dimid.substring(PREFIX.length());
		return dimid;
	}
}
